<!--
 * @Description  : docx预览
 * @Author       : zhao
 * @Date         : 2022-07-21 14:52:05
 * @LastEditors  : zhao
 * @LastEditTime : 2022-07-21 15:16:05
-->

<template>
    <div class='' ref="file">

    </div>
</template>

<script>

let docx = require("docx-preview");
export default {
    name: '',
    data() {
        return {

        }
    },
    watch: {

        "$store.state.borrowForm.previewType": {
            handler: function (val, oldVal) {
                this.goPreview(val.data)
            },
            immediate: true,
            deep: true



        },

    },
    components: {},

    computed: {},

    mounted() { },

    methods: {
        goPreview(data) {
            this.$nextTick(() => {

                docx.renderAsync(data, this.$refs.file); // 渲染到页面
            })
        },
    }
}

</script>
<style lang='scss' scoped>
</style>